﻿using System;
using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;

namespace EFExtention.Common.ViewModel {
    public class SingleObjectChildViewModel<TEntity> : ISupportParameter where TEntity : class {
        public virtual TEntity Entity { get; set; }
        protected virtual void OnEntityChanged() {
            UpdateCommands();
        }
        protected virtual void UpdateCommands() { }
        #region ISupportParameter
        object ISupportParameter.Parameter {
            get { return Entity; }
            set { Entity = (TEntity)value; }
        }
        #endregion
    }
}
